//
//  ViewController.m
//  03-UI
//
//  Created by Snow on 16/7/18.
//  Copyright © 2016年 Snow. All rights reserved.
//

#import "ViewController.h"
#import "LabelOfWord.h"
#import "LabelOfWord.h"
#import "ImageOfButton.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    /* 通过UILabel封装实现只显示文字的Button
     通过UIImageView封装实现只显示图片的Button 以上两种方式, 要考虑到通用性。 封装时, 记得使用iOS9新特性
     使用自己封装的控件, 加入到前两天编写的登陆页中
     */
    
    /* 1. */
    LabelOfWord *buttonOfLabel = [[LabelOfWord alloc] initWithFrame:CGRectMake(20, 20, 120, 40) word:@"这是个按钮~" target:self action:@selector(PressButtonOfLabel:)];
    buttonOfLabel.backgroundColor = [UIColor redColor];
    [self.view addSubview:buttonOfLabel
     ];
    
    /* 2. */
    ImageOfButton *buttonOfImage = [[ImageOfButton alloc] initWithFrame:CGRectMake(20, 150, 200, 80) image:[UIImage imageNamed:@"1-13022G43250-50.jpg"] target:self action:@selector(PressButtonOfimage:)];
    [self.view addSubview:buttonOfImage];
}
- (void)PressButtonOfLabel:(LabelOfWord *)label
{
    NSLog(@"你点击了label做的按钮~");
}
- (void)PressButtonOfimage:(UIImageView *)imageView
{
    NSLog(@"你点击了ImageView做的button");
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
